<%@ page language="java" import="java.util.*,com.hs.dnms.model.*" pageEncoding="utf-8"%>
 <%
   DnmsBook obj = (DnmsBook)request.getAttribute("obj"); 
   
  %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<%@ include file="../../include.jsp"%>  
<script language="javascript" type="text/javascript" src="<%=basePath%>common/uploadify/jquery-1.4.2.min.js"></script>
<script language="javascript" type="text/javascript" src="<%=basePath%>common/javascripts/My97DatePicker/WdatePicker.js"></script>
<script language="javascript" type="text/javascript" src="<%=basePath%>common/uploadify/jquery.uploadify.v2.1.4.js"></script>
<script type="text/javascript" src="<%=basePath%>common/uploadify/swfobject.js"></script>
<LINK rel=stylesheet type=text/css href="<%=basePath%>common/uploadify/uploadify.css"/>  
<script src='<%=basePath%>dwr/interface/dataProhelper.js'></script>  

<script language="javascript" type="text/javascript">

function dataPro(id){
	window.location.href="";

}
/**
文件上传
*/
$(document).ready(function()
        {   
            $("#uploadify").uploadify({ 
            'uploader': '<%=basePath%>common/uploadify/uploadify.swf',
	　　		'script': '<%=basePath%>produce/fileSave.do?id=<%=obj==null?"":obj.getId()%>', 
	　　		'cancelImg': '<%=basePath%>common/uploadify/cancel.png', 
	        'queueID':'fileQueue', 
	        'fileDataName':'bookfile',
	        'fileExt': '*.PDF;*.pdf;',
	        'fileDesc':'请选择PDF文件类型',  
        	'wmode': 'transparent', 
        	'auto': false,
       		'multi': true,
       		'simUploadLimit':999,
       		'buttonImg':'<%=path%>/common/uploadify/selectfile.gif',
       		'sizeLimit':9999999999,
       		'scriptData' :{'newsign':$('#newsign').val()}, 
        	'onSelect':function(){
        	    
        	    // $("#uploadify").uploadifySettings('script',urlinit);
        	},
        	'onProgress':function(){
        		 _grayWindow(true); 
        	},
        	'onComplete': function (event, queueID, fileObj, response, data)
		     { 
		         var returnstr = response; 
 		         callback4Fileinsert(returnstr);
		     } ,
		     'onError': function(event, queueID, fileObj) {  
					alert("文件上传异常:" + event);  
			 }
        	
　　         });
         });
function uploadfile(){ 
 		var newsign=document.getElementById("newsign").value;    
        if(newsign.replace(/\s/g,'') == ''){   
            alert("图片标识不能为空！");   
            return false;   
        }     
        //设置 scriptData 的参数   
        $('#uploadify').uploadifySettings('scriptData',{'newsign':$('#newsign').val()});
	    $('#uploadify').uploadifyUpload();
}
/**
文件上传回调函数
*/	       
var fileid = 0;
function callback4Fileinsert(message){  
        window.opener.location.replace( window.opener.location.href); 
       alert("文件上传成功");
        _grayWindow(false); 
}
  function callback4FileDelete(data){  
  		var tbody  = document.getElementById("listfile");// tbody 的id
  		var rowobj = document.getElementById("file_"+data); 
  		tbody.removeChild(rowobj);
  }
  function deleteFile(fileid){ 
  		if(confirm("确认要删除该文档吗?")){
  			dataProhelper.deleteFile(fileid,callback4FileDelete);
  		} 
  }	   
/**疾病信息保存结束**/	           
</script>
</head>
<body>
<div class="deta_proce">
    <ul>
        <li>数据加工</li> 
    </ul>
    <div>
        <table border="0" cellspacing="0" cellpadding="0"> 
        <caption>
          题录信息
          </caption>
          <tr>
            <td width="15%">书籍名称</td>
            <td width="35%"><%=StringUtilTool.NULL2Blank(obj.getBookname()) %></td>
            <td width="15%">作者</td>
            <td width="35%"><%=StringUtilTool.NULL2Blank(obj.getAuthor())%></td>
          </tr>
          <tr>
            <td width="15%">中医疾病</td>
            <td width="85%" colspan=3><%=StringUtilTool.NULL2Blank(obj.getDiseasename()) %></td> 
          </tr>
          <tr>
            <td width="15%">出版年份</td>
            <td width="35%"><%=StringUtilTool.NULL2Blank(obj.getPublishdate()) %></td>
            <td width="15%">出版社</td>
            <td width="35%"><%=StringUtilTool.NULL2Blank(obj.getPublishhouse()) %></td>
          </tr> 
        </table> 
         <table border="0" cellspacing="0" cellpadding="0">
          <caption>
          附件上传
          </caption> 
          <tr>
          	<td>请输入图片的标识</td>
          	<td>
          		<input id="newsign" name="newsign" type="text" class="sear_input" value=""/>
          	</td>
          </tr>
          <tr>
            <td colspan=2>
            <span id="fileQueue"></span>
            <input type="file" name="uploadify" id="uploadify" />&nbsp;&nbsp;
            <input type="button" onclick="uploadfile();" value="开始上传" class="butt4"/> 
            </td>
          </tr>
          
        </table>
    </div>
</div> 
</body>
</html>

